<template>
  <div>
    <h3>学生姓名：{{name}}</h3>
    <h3>学生年龄：{{age}}</h3>
    <button @click="transfer">点我传数据</button>
    <button @click="unbind">点我解绑</button>
  </div>
</template>

<script>
export default {
  name: 'student',
  data () {
    return {
      name: 'huihui',
      age: 18
    }
  },
  methods: {
    transfer () {
      this.$emit('huihui', this.age)
    },

    // 解绑！！
    unbind () {
      this.$off('huihui')
    }
  }
}
</script>

<style scoped>
</style>